const { userLogin } = require('../services/user')
const { SuccessModel, ErrorModel } = require('../model/ModelInfo')
const { userLoginError } = require('../model/ErrorInfo')

module.exports = {
  async login (userName, password) {
    const result = await userLogin({userName, password})
    if (!result) {
      return new ErrorModel(userLoginError)
    }
    return new SuccessModel()
  }
}
